Skip to content

Add Node.isConnected - #75

Closed
cowboyd wants to merge 3 commits into
dom-get-element-by-idfrom
dom-is-connected
Closed

cowboyd wants to merge 3 commits into
dom-get-element-by-idfrom
dom-is-connected

Conversation

@cowboyd

@cowboyd cowboyd commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Add Node.isConnected as a prerequisite for programmatic focus. The getter walks ancestors until it reaches a Document and reflects attachment and removal immediately.

This starts the focus stack on the shared DOM foundation in #70. Document fragments, ID lookup, element interfaces, and live collections are inherited from that common stack. The connectivity case runs directly from upstream WPT.

Validation

  • 221 workspace tests and 1,119 upstream WPT cases pass at the focus stack tip.
  • Lint, formatting, UI declaration build, and WPT package typecheck pass.

Type of change

  • Bug fix
  • Feature
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have added a changeset

AI-generated code disclosure

  • This PR includes AI-generated code

@pkg-pr-new

pkg-pr-new Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/bombshell-dev/ui/@clack/ui@75

commit: 7c0bb12

@cowboyd
cowboyd marked this pull request as ready for review November 13, 2026 20:25
@cowboyd cowboyd mentioned this pull request Nov 14, 2026
3 of 9 tasks
@cowboyd
cowboyd added this pull request to stack #77 November 14, 2026 06:33
@cowboyd
cowboyd marked this pull request as draft November 17, 2026 17:46
@cowboyd
cowboyd force-pushed the dom-is-connected branch 2 times, most recently from 2fb1ba3 to e743434 Compare November 17, 2026 21:35
@cowboyd
cowboyd force-pushed the dom-is-connected branch 2 times, most recently from 1f16d9c to bdf0c33 Compare November 17, 2026 22:12
@cowboyd
cowboyd removed this pull request from stack #77 November 17, 2026 22:40
@cowboyd
cowboyd changed the base branch from dom-get-element-by-id to dom-default-view November 17, 2026 22:40
@cowboyd
cowboyd added this pull request to stack #92 November 17, 2026 22:40
@cowboyd
cowboyd removed this pull request from stack #92 November 17, 2026 22:49
@cowboyd
cowboyd changed the base branch from dom-default-view to dom-id-lookup November 17, 2026 22:49
@cowboyd
cowboyd added this pull request to stack #94 November 17, 2026 22:49
@cowboyd
cowboyd removed this pull request from stack #94 November 18, 2026 02:24
@cowboyd
cowboyd added this pull request to stack #96 November 18, 2026 02:24
@cowboyd
cowboyd removed this pull request from stack #96 November 18, 2026 02:27
@cowboyd
cowboyd removed this pull request from stack #98 November 19, 2026 17:17
@cowboyd
cowboyd changed the base branch from dom-id-lookup to dom-get-element-by-id November 19, 2026 17:17
@cowboyd cowboyd mentioned this pull request Nov 19, 2026
3 of 9 tasks
@cowboyd
cowboyd added this pull request to stack #106 November 19, 2026 17:18
cowboyd added a commit that referenced this pull request Nov 19, 2026
## What does this PR do?

Add `Document.createDocumentFragment()`, fragment node identity,
descendant `textContent`, and insertion that transfers children in order
and returns the emptied fragment. Enable the corresponding original Web
Platform Tests.

This starts the shared DOM foundation used by styling (#38) and focus
(#75). The next PR, #70, adds document lookup and live collections on
top of these node primitives. The WPT runner is inherited from `main`.

## Type of change

- [ ] Bug fix
- [x] Feature
- [ ] Refactor (no behavior change)
- [ ] Documentation
- [ ] Performance improvement
- [ ] Tests
- [ ] Chore (dependencies, CI, tooling)

## Checklist

- [x] I have added a changeset

## AI-generated code disclosure

- [x] This PR includes AI-generated code
@cowboyd
cowboyd marked this pull request as ready for review November 19, 2026 17:25
@cowboyd
cowboyd marked this pull request as draft November 19, 2026 19:19
@cowboyd

cowboyd commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

no stacks on stacks

@cowboyd cowboyd closed this Nov 20, 2026
cowboyd added a commit that referenced this pull request Nov 23, 2026
## What does this PR do?

Provide the shared DOM lookup layer at the base of [the styling
stack](https://github.com/bombshell-dev/ui/stack/107). The focus stack
(#75) also depends on this PR; document fragments from #90 are already
on main.

- `Document.getElementById()` finds the first matching element in
current tree order and reflects ID changes, insertion, removal, and
reordering.
- `findElement` and `findElements` reuse the CSS selector adapter for
literal predicate traversal.
- `Document.getElementsByTagName()` returns live `HTMLCollection`
results with indexed access, iteration, and named lookup.
- `HTMLDivElement` is registered once in the document factory and WPT
bindings.

## Type of change

- [ ] Bug fix
- [x] Feature
- [ ] Refactor (no behavior change)
- [ ] Documentation
- [ ] Performance improvement
- [ ] Tests
- [ ] Chore (dependencies, CI, tooling)

## Checklist

- [x] I have added a changeset

## AI-generated code disclosure

- [x] This PR includes AI-generated code
cowboyd added a commit that referenced this pull request Nov 23, 2026
## What does this PR do?

This adds a style system that hews as closely to CSS as possible. It is
not, and cannot be, CSS compliant, but where CSS styles provide an
answer, it uses it. It's fair to describe it as a _subset_ of CSS.

This CSS based system is completely decoupled from TTY styling and so
every property is explicitly mapped over. Included in this PR are styles
for display, flex direction, spacing, borders, and CSS colors.

<img width="470" height="236" alt="image"
src="https://github.com/user-attachments/assets/2d31eabd-cd4f-4300-a4e0-a3167cb6540d"
/>


Currently there are only default styles and inline styles of an element,
but we can later add style rules that match.


<img width="195" height="125" alt="image"
src="https://github.com/user-attachments/assets/478111c4-8a52-4001-a82f-e725e55f2919"
/>

The existing style cases now run directly from original WPT sources on
the native WPT base (#87). Relevant spec: CSSOM’s [CSSStyleDeclaration
interface](https://drafts.csswg.org/cssom/#the-cssstyledeclaration-interface).

This follows shared DOM lookup #70 in [the styling
stack](https://github.com/bombshell-dev/ui/stack/107). The focus stack
starting at #75 also depends on #70.

## Validation

- 267 workspace tests and 734 upstream WPT cases pass at the styling
stack tip.
- Build, lint, formatting, and WPT package typecheck pass.

## Type of change

- [ ] Bug fix
- [x] Feature
- [ ] Refactor (no behavior change)
- [ ] Documentation
- [ ] Performance improvement
- [ ] Tests
- [ ] Chore (dependencies, CI, tooling)

## Checklist

- [x] I have added a changeset

## AI-generated code disclosure

- [x] This PR includes AI-generated code

I used AI to generate test cases, and occasionally suggest code
snippets.

Subsequent AI assistance also includes implementation, WPT adaptations,
validation, and PR splitting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants